Add support for opensearch searchable snapshot metrics #860
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Elasticsearch & Opensearch both have a Searchable Snapshots feature that emit metrics from unique API endpoints:
The Elasticsearch Searchable Snapshots metrics appear to be available via the
es.snapshots
argument, while there does not yet appear to be a similar argument for Opensearch Searchable Snapshot metrics.A minimal amount of changes were realized to add support for these metrics, leveraging existing structs & other data types with a new node role while adding necessary elements to for example
nodeMetrics
(collector/nodes.go).Motivation and Context
The motivation of this PR is to add support for Opensearch Searchable Snapshots to the
elasticsearch_exporter
so that they can be scraped by Prometheus for monitoring & serviceability.Several modifications have been made in a fork to quickly add support for these. A better way to emit these more than likely exists so that for example only nodes with
es_search_node=true
would be collected. Moreover, adding a CLI argument to enable these metrics as they are not applicable to Elasticsearch. The changes in this PR could be a decent starting place however if not at least found useful by others.Details
The proposed changes add 8x new metrics to the collection from the Opensearch Nodes API: